package com.salelogistics.basic.service.impl;

import java.util.List;
import com.salelogistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.basic.mapper.BasMaterialBrandMapper;
import com.salelogistics.basic.domain.BasMaterialBrand;
import com.salelogistics.basic.service.IBasMaterialBrandService;

/**
 * 材料品牌Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-20
 */
@Service
public class BasMaterialBrandServiceImpl implements IBasMaterialBrandService 
{
    @Autowired
    private BasMaterialBrandMapper basMaterialBrandMapper;

    /**
     * 查询材料品牌
     * 
     * @param materialBrandId 材料品牌主键
     * @return 材料品牌
     */
    @Override
    public BasMaterialBrand selectBasMaterialBrandByMaterialBrandId(Long materialBrandId)
    {
        return basMaterialBrandMapper.selectBasMaterialBrandByMaterialBrandId(materialBrandId);
    }

    /**
     * 查询材料品牌列表
     * 
     * @param basMaterialBrand 材料品牌
     * @return 材料品牌
     */
    @Override
    public List<BasMaterialBrand> selectBasMaterialBrandList(BasMaterialBrand basMaterialBrand)
    {
        return basMaterialBrandMapper.selectBasMaterialBrandList(basMaterialBrand);
    }

    /**
     * 新增材料品牌
     * 
     * @param basMaterialBrand 材料品牌
     * @return 结果
     */
    @Override
    public int insertBasMaterialBrand(BasMaterialBrand basMaterialBrand)
    {
        basMaterialBrand.setCreateTime(DateUtils.getNowDate());
        return basMaterialBrandMapper.insertBasMaterialBrand(basMaterialBrand);
    }

    /**
     * 修改材料品牌
     * 
     * @param basMaterialBrand 材料品牌
     * @return 结果
     */
    @Override
    public int updateBasMaterialBrand(BasMaterialBrand basMaterialBrand)
    {
        return basMaterialBrandMapper.updateBasMaterialBrand(basMaterialBrand);
    }

    /**
     * 批量删除材料品牌
     * 
     * @param materialBrandIds 需要删除的材料品牌主键
     * @return 结果
     */
    @Override
    public int deleteBasMaterialBrandByMaterialBrandIds(Long[] materialBrandIds)
    {
        return basMaterialBrandMapper.deleteBasMaterialBrandByMaterialBrandIds(materialBrandIds);
    }

    /**
     * 删除材料品牌信息
     * 
     * @param materialBrandId 材料品牌主键
     * @return 结果
     */
    @Override
    public int deleteBasMaterialBrandByMaterialBrandId(Long materialBrandId)
    {
        return basMaterialBrandMapper.deleteBasMaterialBrandByMaterialBrandId(materialBrandId);
    }

    @Override
    public int changeBrandStatus(BasMaterialBrand basMaterialBrand) {
        return basMaterialBrandMapper.changeBrandStatus(basMaterialBrand);
    }

    @Override
    public List<BasMaterialBrand> selectBasMaterialBrandByCode(Long materialBrandCode) {
        return basMaterialBrandMapper.selectBasMaterialBrandByCode(materialBrandCode);
    }
}
